package org.mc.resolver;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

import java.util.List;

/**
 * Created by lenovo on 2018/4/16.
 */
@Configuration
public class WebAuthConfiguration extends WebMvcConfigurerAdapter {

    public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
        super.addArgumentResolvers(argumentResolvers);
        argumentResolvers.add(new AuthUserIdResolver());
    }

    @Bean
    public AuthUserIdResolver authUserIdResolver() {
        return new AuthUserIdResolver();
    }
}
